package controller;

import model.User;

public class RegisterBean {	
	private String username;
	private String password;
	private String confirmPassword;
	private String firstname;
	private String lastname;
	private String address;
	private String phone;
	
	public String getUsername() {
		return username;
	}
	public void setUsername(String username) {
		this.username = username;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	public String getConfirmPassword() {
		return confirmPassword;
	}
	public void setConfirmPassword(String confirmPassword) {
		this.confirmPassword = confirmPassword;
	}
	public String getFirstname() {
		return firstname;
	}
	public void setFirstname(String firstname) {
		this.firstname = firstname;
	}
	public String getLastname() {
		return lastname;
	}
	public void setLastname(String lastname) {
		this.lastname = lastname;
	}
	public String getAddress() {
		return address;
	}
	public void setAddress(String address) {
		this.address = address;
	}
	public String getPhone() {
		return phone;
	}
	public void setPhone(String phone) {
		this.phone = phone;
	}
	
	public String register() {
		User temp = new User();
		int status = 0;
		
		if (password.equals(confirmPassword)) {
			status = temp.register(username, password, firstname, lastname, address, phone);
		}
		
		if (status == 1)
			return "success";
		
		return null;
	}
	
}
